package com.cw.base.jeeyc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cw.base.common.model.dto.response.CommonRespDto;
import com.cw.base.jeeyc.biz.intf.DeployDictBiz;
import com.cw.base.jeeyc.deploy.dto.DeployDictDto;
import com.cw.base.jeeyc.deploy.intf.DeployDictApi;

/**
 * 数据字典接口层
 *
 * @author chenw
 * @date 2019-08-26 21:21:57
 */
@RestController
@RequestMapping("/v1/deployDict")
public class DeployDictApiImpl implements DeployDictApi {
    @Autowired
    private DeployDictBiz deployDictBiz;
    /**
     * 新增数据字典
     *
     * @param request 条件
     * @return boolean
     */
    @Override
    public CommonRespDto<String> addDeployDict(@RequestBody DeployDictDto request) {
        return CommonRespDto.<String>builder().data(
            deployDictBiz.addDeployDict(request)).build();
    }

    /**
     * 更新数据字典
     *
     * @param request 条件
     * @return String
     */
    @Override
    public CommonRespDto<Boolean> modifyDeployDict(@RequestBody DeployDictDto request) {
        return CommonRespDto.<Boolean>builder().data(
            deployDictBiz.modifyDeployDict(request)).build();
    }

    /**
     * 删除数据字典
     *
     * @param request 条件
     * @return boolean
     */
    @Override
    public CommonRespDto<Boolean> deleteDeployDict(@RequestBody DeployDictDto request) {
        return CommonRespDto.<Boolean>builder().data(deployDictBiz.deleteDeployDict(request)).build();
    }
}
